var shareUrl = 'http://csvw.fevaways.com/2017greetingcard/Christmasday3/';
        function queryString(str){
            var sValue=location.search.match(new RegExp("[\?\&]"+str+"=([^\&]*)(\&?)","i"));
            return sValue?sValue[1]:sValue;
        }

var name = queryString('name');
var num = queryString('num');
$(function() {
    $.get("http://wechat.skoda.com.cn/skodamms/mms/sign.html?url="+encodeURIComponent(window.location.href), function(data) {
        console.log(data);
        wx.config({
            debug : false,
            appId : 'wxdce48bca77d65897',
            timestamp : data.timestamp,
            nonceStr : data.nonceStr,
            signature : data.signature,
            jsApiList : [ 'onMenuShareTimeline', 'onMenuShareAppMessage' ]
        });
    }, "json");
    
    wx.ready(function() {
        var title = 'GREETINGS FROM SAIC VOLKSWAGEN';
        var desc = 'MERRY CHRISTMAS & HAPPY NEW YEAR';
        var imgUrl = shareUrl + "img/mobile/share.jpg";
        var link = shareUrl+'mobile/index.html?name='+name+'&num='+num;
        shareData = {
            title: title ,
            desc: desc,
            imgUrl: imgUrl ,
            link: link ,
            success: function (res) {
            },
            cancel: function (res) {
            }
        };       
        wx.onMenuShareAppMessage(shareData);
        wx.onMenuShareTimeline(shareData); 
        
        
        wx.getNetworkType({
            success: function (res) {
                //alert(res.networkType);
                document.getElementById('bgm').play();
            }
        });
        
    });

}); 


        

